<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    手机号码： <input type="number"> <button>发送</button>
    <script>
        var btn = document.querySelector('button');
        btn.addEventListener('click', function() {
            this.disabled = true;

            var time = 3;

            function timer() {

                if (time > 0) {
                    time--;
                    btn.innerHTML = '还剩' + time + '秒';
                } else {
                    clearInterval(timers);
                    btn.disabled = false;
                    btn.innerHTML = '发送';
                }
            }
            var timers = setInterval(timer, 1000)

        })
    </script>
</body>

</html>